import React from 'react'
import {Route, Routes,Navigate} from 'react-router-dom'
import Login from './views/Login'
import Home from './views/Home'
import Register from './views/Register'
import Index from './views/admin/Index'
import XiTong from './views/admin/XiTong'
import Wuye from './views/admin/Wuye'
import Menu from './views/admin/Menu'
import Role from './views/admin/Role'
import NotFound from './views/NotFound'
import RoleEdit from './views/admin/RoleEdit'
import RoleDetail from './views/admin/RoleDetail'
import RoleConfig from './views/admin/RoleConfig'
export default function App() {
  return (
    <Routes>
       <Route path='/login' element={<Login/>}></Route>
       <Route path="/register" element={<Register/>}></Route>
       <Route path='/home' element={<Home/>}>
          <Route index element={<Index></Index>}></Route>
          <Route path="sys" element={<XiTong></XiTong>}>
              <Route index element={<Navigate to="/home/sys/role"></Navigate>}></Route>
              <Route path="role" element={<Role></Role>}></Route>
              <Route path='menu' element={<Menu></Menu>}></Route>
              <Route path='roleEdit' element={<RoleEdit></RoleEdit>}></Route>
              <Route path='roleDetail/:id/:pid' element={<RoleDetail></RoleDetail>}></Route>
              <Route path='roleConfig' element={<RoleConfig></RoleConfig>}></Route>
          </Route>
          <Route path="wy" element={<Wuye></Wuye>}></Route>
       </Route>
       <Route path='*' element={<NotFound></NotFound>}></Route>
    </Routes>
  )
}
